import React from "react";
import PropTypes from "prop-types";
import {SuperSelect, Option} from "../../../components/SuperSelect";

function SimpleSelect(props) {
    const {types, value, onSelect} = props;

    return (
        <SuperSelect
            optionFilterProp="children"
            showSearch={false}
            dropdownMatchSelectWidth={false}
            className={"super-select"}
            value={value}
            onSelect={onSelect}>
            {types.map(rule => <Option key={rule} value={rule}>{rule}</Option>)}
        </SuperSelect>
    )
}

SimpleSelect.propTypes = {
    types: PropTypes.array,
    value: PropTypes.string,
    onSelect: PropTypes.func
}
export default SimpleSelect;